﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace MAT.Controllers
{
    class ctrOption
    {
        public static frmOption _frmOption = null;

        public frmOption FrmOption
        {
            get { return _frmOption; }
            set { _frmOption = value; }
        }
        public static int rip=0;
        public void btnUserAccount_Click()
        {
            _frmOption.btnUserAccount.Location = new Point(217, 122);
            

            _frmOption.grpUserAcc.Visible = true;
            _frmOption.grpUserAcc.Location = new Point(400,186);
            
            _frmOption.btnAction.Visible = false;
            _frmOption.btnReport.Visible = false;
            _frmOption.btnManage.Visible = false;
            _frmOption.btnRequest.Visible = false;
            _frmOption.btnAboutUs.Visible = false;

            _frmOption.btnActionMini.Visible = true;
            _frmOption.btnManageMini.Visible = true;
            _frmOption.btnReportMini.Visible = true;
            _frmOption.btnRequestMini.Visible = true;
            _frmOption.btnAboutMini.Visible = true;
            
            _frmOption.btnActionMini.Location = new Point(93, 395);
            _frmOption.btnManageMini.Location = new Point(285, 398);
            _frmOption.btnReportMini.Location = new Point(455, 401);
            _frmOption.btnRequestMini.Location = new Point(637, 404);
            _frmOption.btnAboutMini.Location = new Point(817, 401);
        }
        public void btnAction_Click()
        {
            _frmOption.btnAction.Location = new Point(217, 122);

            _frmOption.grpAction.Visible = true;
            _frmOption.grpAction.Location = new Point(400, 186);

            _frmOption.btnAboutUs.Visible = false;
            _frmOption.btnUserAccount.Visible = false;
            _frmOption.btnReport.Visible = false;
            _frmOption.btnManage.Visible = false;
            _frmOption.btnRequest.Visible = false;

            _frmOption.btnUserAccMini.Visible = true;
            _frmOption.btnManageMini.Visible = true;
            _frmOption.btnReportMini.Visible = true;
            _frmOption.btnRequestMini.Visible = true;
            _frmOption.btnAboutMini.Visible = true;


            _frmOption.btnUserAccMini.Location = new Point(93, 395);
            _frmOption.btnManageMini.Location = new Point(285, 398);
            _frmOption.btnReportMini.Location = new Point(455, 401);
            _frmOption.btnRequestMini.Location = new Point(637, 404);
            _frmOption.btnAboutMini.Location = new Point(817, 401);
        }
        public void btnManage_Click()
        {
            _frmOption.btnManage.Location = new Point(217, 122);

            _frmOption.grpManage.Visible = true;
            _frmOption.grpManage.Location = new Point(400, 186);

            _frmOption.btnAction.Visible = false;
            _frmOption.btnAboutUs.Visible = false;
            _frmOption.btnUserAccount.Visible = false;
            _frmOption.btnReport.Visible = false;
            _frmOption.btnRequest.Visible = false;

            _frmOption.btnUserAccMini.Visible = true;
            _frmOption.btnActionMini.Visible = true;
            _frmOption.btnReportMini.Visible = true;
            _frmOption.btnRequestMini.Visible = true;
            _frmOption.btnAboutMini.Visible = true;

            _frmOption.btnUserAccMini.Location = new Point(93, 395);
            _frmOption.btnActionMini.Location = new Point(285, 398);
            _frmOption.btnReportMini.Location = new Point(455, 401);
            _frmOption.btnRequestMini.Location = new Point(637, 404);
            _frmOption.btnAboutMini.Location = new Point(817, 401);
        }
        public void btnReport_Click()
        {
            _frmOption.btnReport.Location = new Point(217, 122);

            _frmOption.grpReport.Visible = true;
            _frmOption.grpReport.Location = new Point(400, 186);

            _frmOption.btnAboutUs.Visible = false;
            _frmOption.btnUserAccount.Visible = false;
            _frmOption.btnManage.Visible = false;
            _frmOption.btnAction.Visible = false;
            _frmOption.btnRequest.Visible = false;

            _frmOption.btnUserAccMini.Visible = true;
            _frmOption.btnActionMini.Visible = true;
            _frmOption.btnManageMini.Visible = true;
            _frmOption.btnRequestMini.Visible = true;
            _frmOption.btnAboutMini.Visible = true;

            _frmOption.btnUserAccMini.Location = new Point(93, 395);
            _frmOption.btnActionMini.Location = new Point(285, 398);
            _frmOption.btnManageMini.Location = new Point(455, 401);
            _frmOption.btnRequestMini.Location = new Point(637, 404);
            _frmOption.btnAboutMini.Location = new Point(817, 401);
        }
        public void btnRequest_Click()
        {
            _frmOption.btnRequest.Location = new Point(217, 122);

            _frmOption.grpRequest.Visible = true;
            _frmOption.grpRequest.Location = new Point(400, 186);

            _frmOption.btnUserAccount.Visible = false;
            _frmOption.btnAction.Visible = false;
            _frmOption.btnReport.Visible = false;
            _frmOption.btnManage.Visible = false;
            _frmOption.btnAboutUs.Visible = false;

            _frmOption.btnRequestMini.Visible = false;

            _frmOption.btnUserAccMini.Visible = true;
            _frmOption.btnActionMini.Visible = true;
            _frmOption.btnManageMini.Visible = true;
            _frmOption.btnReportMini.Visible = true;
            _frmOption.btnAboutMini.Visible = true;

            _frmOption.btnUserAccMini.Location = new Point(93, 404);
            _frmOption.btnActionMini.Location = new Point(290, 398);
            _frmOption.btnManageMini.Location = new Point(455, 401);
            _frmOption.btnReportMini.Location = new Point(637, 404);
            _frmOption.btnAboutMini.Location = new Point(817, 401);


        }
        public void btnAboutUs_Click()
        {
            _frmOption.btnAboutUs.Location = new Point(217, 122);

            _frmOption.grpAbout.Visible = true;
            _frmOption.grpAbout.Location = new Point(400, 186);

            _frmOption.btnReport.Visible = false;
            _frmOption.btnUserAccount.Visible = false;
            _frmOption.btnManage.Visible = false;
            _frmOption.btnAction.Visible = false;
            _frmOption.btnRequest.Visible = false;

            _frmOption.btnUserAccMini.Visible = true;
            _frmOption.btnActionMini.Visible = true;
            _frmOption.btnManageMini.Visible = true;
            _frmOption.btnReportMini.Visible = true;
            _frmOption.btnRequestMini.Visible = true;

            _frmOption.btnUserAccMini.Location = new Point(93, 395);
            _frmOption.btnActionMini.Location = new Point(285, 398);
            _frmOption.btnManageMini.Location = new Point(455, 401);
            _frmOption.btnRequestMini.Location = new Point(637, 404);
            _frmOption.btnRequestMini.Location = new Point(817, 401);
        }
        public void button1_Click()
        {
            _frmOption.grpRequest.Visible = true;
            _frmOption.grpRequest.Location = new Point(218, 211);
        }

        //button mini
        public void btnUserAccMini_Click()
        {
            _frmOption.btnUserAccount.Visible = true;
            _frmOption.btnUserAccount.Location = new Point(217, 122);

            _frmOption.grpUserAcc.Visible = true;
            _frmOption.grpUserAcc.Location = new Point(400, 186);

            _frmOption.grpAction.Visible = false;
            _frmOption.grpManage.Visible = false;
            _frmOption.grpReport.Visible = false;
            _frmOption.grpRequest.Visible = false;
            _frmOption.grpAbout.Visible = false;

            _frmOption.btnAction.Visible = false;
            _frmOption.btnReport.Visible = false;
            _frmOption.btnManage.Visible = false;
            _frmOption.btnRequest.Visible = false;
            _frmOption.btnAboutUs.Visible = false;
            
            _frmOption.btnUserAccMini.Visible = false;
            _frmOption.btnActionMini.Visible = true;
            _frmOption.btnManageMini.Visible = true;
            _frmOption.btnReportMini.Visible = true;
            _frmOption.btnRequestMini.Visible = true;
            _frmOption.btnAboutMini.Visible = true;

            
            _frmOption.btnActionMini.Location = new Point(93, 395);
            _frmOption.btnManageMini.Location = new Point(285, 398);
            _frmOption.btnReportMini.Location = new Point(455, 401);
            _frmOption.btnRequestMini.Location = new Point(637, 404);
            _frmOption.btnAboutMini.Location = new Point(817, 401);
        }
        public void btnActionMini_Click()
        {
            _frmOption.btnAction.Visible = true;
            _frmOption.btnAction.Location = new Point(217, 122);

            _frmOption.grpAction.Visible = true;
            _frmOption.grpAction.Location = new Point(400, 186);

            _frmOption.grpUserAcc.Visible = false;
            _frmOption.grpManage.Visible = false;
            _frmOption.grpReport.Visible = false;
            _frmOption.grpRequest.Visible = false;
            _frmOption.grpAbout.Visible = false;

            _frmOption.btnUserAccount.Visible = false;
            _frmOption.btnReport.Visible = false;
            _frmOption.btnManage.Visible = false;
            _frmOption.btnRequest.Visible = false;
            _frmOption.btnAboutUs.Visible = false;

            _frmOption.btnActionMini.Visible = false;
            _frmOption.btnUserAccMini.Visible = true;
            _frmOption.btnManageMini.Visible = true;
            _frmOption.btnReportMini.Visible = true;
            _frmOption.btnRequestMini.Visible = true;
            _frmOption.btnAboutMini.Visible = true;


            _frmOption.btnUserAccMini.Location = new Point(93, 395);
            _frmOption.btnManageMini.Location = new Point(285, 398);
            _frmOption.btnReportMini.Location = new Point(455, 401);
            _frmOption.btnRequestMini.Location = new Point(637, 404);
            _frmOption.btnAboutMini.Location = new Point(817, 401);
        }

        public void btnManageMini_Click()
        {
            _frmOption.btnManage.Visible = true;
            _frmOption.btnManage.Location = new Point(217, 122);

            _frmOption.grpManage.Visible = true;
            _frmOption.grpManage.Location = new Point(400, 186);

            _frmOption.grpUserAcc.Visible = false;
            _frmOption.grpAction.Visible = false;
            _frmOption.grpReport.Visible = false;
            _frmOption.grpRequest.Visible = false;
            _frmOption.grpAbout.Visible = false;

            _frmOption.btnUserAccount.Visible = false;
            _frmOption.btnReport.Visible = false;
            _frmOption.btnAction.Visible = false;
            _frmOption.btnRequest.Visible = false;
            _frmOption.btnAboutUs.Visible = false;

            _frmOption.btnManageMini.Visible = false;
            _frmOption.btnUserAccMini.Visible = true;
            _frmOption.btnActionMini.Visible = true;
            _frmOption.btnReportMini.Visible = true;
            _frmOption.btnRequestMini.Visible = true;
            _frmOption.btnAboutMini.Visible = true;


            _frmOption.btnUserAccMini.Location = new Point(93, 395);
            _frmOption.btnActionMini.Location = new Point(285, 398);
            _frmOption.btnReportMini.Location = new Point(455, 401);
            _frmOption.btnRequestMini.Location = new Point(637, 404);
            _frmOption.btnAboutMini.Location = new Point(817, 401);
        }
        public void btnReportMini_Click()
        {
            _frmOption.btnReport.Visible = true;
            _frmOption.btnReport.Location = new Point(217, 122);

            _frmOption.grpReport.Visible = true;
            _frmOption.grpReport.Location = new Point(400, 186);

            _frmOption.grpUserAcc.Visible = false;
            _frmOption.grpAction.Visible = false;
            _frmOption.grpManage.Visible = false;
            _frmOption.grpRequest.Visible = false;
            _frmOption.grpAbout.Visible = false;

            _frmOption.btnUserAccount.Visible = false;
            _frmOption.btnManage.Visible = false;
            _frmOption.btnAction.Visible = false;
            _frmOption.btnRequest.Visible = false;
            _frmOption.btnAboutUs.Visible = false;

            _frmOption.btnReportMini.Visible = false;
            _frmOption.btnUserAccMini.Visible = true;
            _frmOption.btnActionMini.Visible = true;
            _frmOption.btnManageMini.Visible = true;
            _frmOption.btnRequestMini.Visible = true;
            _frmOption.btnAboutMini.Visible = true;

            _frmOption.btnUserAccMini.Location = new Point(93, 395);
            _frmOption.btnActionMini.Location = new Point(285, 398);
            _frmOption.btnManageMini.Location = new Point(455, 401);
            _frmOption.btnRequestMini.Location = new Point(637, 404);
            _frmOption.btnAboutMini.Location = new Point(817, 401);
        }
        public void btnRequestMini_Click()
        {
            _frmOption.btnRequest.Visible = true;
            _frmOption.btnRequest.Location = new Point(217, 122);

            _frmOption.grpRequest.Visible = true;
            _frmOption.grpRequest.Location = new Point(400, 186);

            _frmOption.grpUserAcc.Visible = false;
            _frmOption.grpAction.Visible = false;
            _frmOption.grpManage.Visible = false;
            _frmOption.grpReport.Visible = false;
            _frmOption.grpAbout.Visible = false;

            _frmOption.btnUserAccount.Visible = false;
            _frmOption.btnManage.Visible = false;
            _frmOption.btnAction.Visible = false;
            _frmOption.btnReport.Visible = false;
            _frmOption.btnAboutUs.Visible = false;

            _frmOption.btnRequestMini.Visible = false;
            _frmOption.btnUserAccMini.Visible = true;
            _frmOption.btnActionMini.Visible = true;
            _frmOption.btnManageMini.Visible = true;
            _frmOption.btnReportMini.Visible = true;
            _frmOption.btnAboutMini.Visible = true;

            _frmOption.btnUserAccMini.Location = new Point(93, 395);
            _frmOption.btnActionMini.Location = new Point(285, 398);
            _frmOption.btnManageMini.Location = new Point(455, 401);
            _frmOption.btnReportMini.Location = new Point(637, 404);
            _frmOption.btnAboutMini.Location = new Point(817, 401);
        }
        public void btnAboutMini_Click()
        {
            _frmOption.btnAboutUs.Visible = true;
            _frmOption.btnAboutUs.Location = new Point(217, 122);

            _frmOption.grpAbout.Visible = true;
            _frmOption.grpAbout.Location = new Point(400, 186);

            _frmOption.grpUserAcc.Visible = false;
            _frmOption.grpAction.Visible = false;
            _frmOption.grpManage.Visible = false;
            _frmOption.grpReport.Visible = false;
            _frmOption.grpRequest.Visible = false;

            _frmOption.btnUserAccount.Visible = false;
            _frmOption.btnManage.Visible = false;
            _frmOption.btnAction.Visible = false;
            _frmOption.btnReport.Visible = false;
            _frmOption.btnRequest.Visible = false;

            _frmOption.btnActionMini.Visible = false;

            _frmOption.btnUserAccMini.Visible = true;
            _frmOption.btnActionMini.Visible = true;
            _frmOption.btnManageMini.Visible = true;
            _frmOption.btnReportMini.Visible = true;
            _frmOption.btnRequestMini.Visible = true;

            _frmOption.btnUserAccMini.Location = new Point(93, 395);
            _frmOption.btnActionMini.Location = new Point(285, 398);
            _frmOption.btnManageMini.Location = new Point(455, 401);
            _frmOption.btnReportMini.Location = new Point(637, 404);
            _frmOption.btnRequestMini.Location = new Point(817, 401);
        }

        public void frmOption_Load()
        {
            _frmOption.btnUserAccMini.Visible = false;
            _frmOption.btnActionMini.Visible = false;
            _frmOption.btnManageMini.Visible = false;
            _frmOption.btnReportMini.Visible = false;
            _frmOption.btnAboutMini.Visible = false;
            _frmOption.btnRequestMini.Visible = false;
            _frmOption.grpUserAcc.Visible = false;
            _frmOption.grpAction.Visible = false;
            _frmOption.grpManage.Visible = false;
            _frmOption.grpReport.Visible = false;
            _frmOption.grpRequest.Visible = false;
            _frmOption.grpAbout.Visible = false;
            switch (MAT.Controllers.ctrLogin.priority)
            {
                case 0: priority_admin0(); break;
                case 1: priority_admin1(); break;
                case 2: priority_admin2(); break;
                case 3: priority_user(); break;
            }
        }
        private void priority_admin0()
        {
            _frmOption.btnUserAccount.Enabled = true;
            _frmOption.btnAction.Enabled = true;
            _frmOption.btnManage.Enabled = true;
            _frmOption.btnReport.Enabled = true;
            _frmOption.btnRequest.Enabled = true;
            _frmOption.btnAboutUs.Enabled = true;
            _frmOption.btnUserAccMini.Enabled = true;
            _frmOption.btnActionMini.Enabled = true;
            _frmOption.btnManageMini.Enabled = true;
            _frmOption.btnReportMini.Enabled = true;
            _frmOption.btnRequestMini.Enabled = true;
            _frmOption.btnAboutMini.Enabled = true;

        }
        private void priority_admin1()
        {
            _frmOption.btnUserAccount.Enabled = true;
            _frmOption.btnAction.Enabled = true;
            _frmOption.btnManage.Enabled = true;
            _frmOption.btnReport.Enabled = true;
            _frmOption.btnRequest.Enabled = true;
            _frmOption.btnAboutUs.Enabled = true;
            _frmOption.btnUserAccMini.Enabled = true;
            _frmOption.btnActionMini.Enabled = true;
            _frmOption.btnManageMini.Enabled = true;
            _frmOption.btnReportMini.Enabled = true;
            _frmOption.btnRequestMini.Enabled = true;
            _frmOption.btnAboutMini.Enabled = true;
        }
        private void priority_admin2()
        {
            _frmOption.btnUserAccount.Enabled = true;
            _frmOption.btnAction.Enabled = true;
            _frmOption.btnManage.Enabled = true;
            _frmOption.btnReport.Enabled = true;
            _frmOption.btnRequest.Enabled = true;
            _frmOption.btnAboutUs.Enabled = true;
            _frmOption.btnUserAccMini.Enabled = true;
            _frmOption.btnActionMini.Enabled = true;
            _frmOption.btnManageMini.Enabled = true;
            _frmOption.btnReportMini.Enabled = true;
            _frmOption.btnRequestMini.Enabled = true;
            _frmOption.btnAboutMini.Enabled = true;
        }
        private void priority_user()
        {
            _frmOption.btnUserAccount.Enabled = true;
            _frmOption.labChangePass.Enabled = true;
            _frmOption.labManageUser.Enabled = false;
            _frmOption.btnAction.Enabled = true;
            _frmOption.labViewAssetProfile.Enabled = true;
            _frmOption.labFind.Enabled = true;
            _frmOption.labMove.Enabled = false;
            _frmOption.labAddNewItem.Enabled = false;
            _frmOption.btnManage.Enabled = false;
            _frmOption.btnReport.Enabled = false;
            _frmOption.btnRequest.Enabled = true;
            _frmOption.btnAboutUs.Enabled = true;
            _frmOption.btnUserAccMini.Enabled = false;
            _frmOption.btnActionMini.Enabled = true;
            _frmOption.btnManageMini.Enabled = true;
            _frmOption.btnReportMini.Enabled = true;
            _frmOption.btnRequestMini.Enabled = true;
            _frmOption.btnAboutMini.Enabled = true;
        }
        public void LAB_CLICKED(object sender, EventArgs e)
        {
            try
            {
                Label LAB = (Label)sender;
                switch (LAB.TabIndex)
                {
                    case 12: rip = 11; break;
                    case 14: rip = 21; break;
                    case 15: rip = 22; break;
                    case 16: rip = 23; break;
                    case 17: rip = 24; break;
                    case 19: rip = 31; break;
                    case 20: rip = 32; break;
                    case 21: rip = 33; break;
                    case 22: rip = 34; break;
                    case 23: rip = 41; break;
                    case 24: rip = 42; break;
                    case 25: rip = 43; break;
                    case 26: rip = 44; break;
                    case 28: rip = 45; break;
                    case 29: rip = 46; break;
                    case 27: rip = 47; break;
                    case 30: rip = 48; break;
                    case 31: rip = 51; break;
                    case 32: rip = 52; break;
                    case 33: rip = 53; break;
                    case 34: rip = 54; break;
                }
                _frmOption.Dispose();
                MAT.Controllers.ctrMain._frmMain = new frmMain();
                MAT.Controllers.ctrMain._frmMain.ShowDialog();
            }
            catch(Exception){}
        }

        public void lblSkip_Click()
        {
            _frmOption.Dispose();
            MAT.Controllers.ctrMain._frmMain = new frmMain();
            MAT.Controllers.ctrMain._frmMain.ShowDialog();
        }
    }
}
